ci(sdk): fix branch parsing for integ framework#189
Conversation
| ' \ | ||
| | head -n1 \ | ||
| | tr -d "\r" | ||
| ) |
There was a problem hiding this comment.
suggestion: make/use a python script rather than bash :-)
| print(f"Using testing SDK branch: {ref}") | ||
| PYTHON | ||
| env: | ||
| PR_BODY: ${{ github.event.pull_request.body }} |
There was a problem hiding this comment.
this could live as a script in the ops/ dir - easier to test there :-)
0d00570 to
e31155c
Compare
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
|
|
||
| - name: Run parser tests | ||
| run: python ops/__tests__/test_parse_sdk_branch.py |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix this problem, add a permissions key to your workflow file, restricting the GITHUB_TOKEN privileges. Place this key either at the root, affecting all jobs, or under the relevant job. In this case, since only one job exists, it's simplest and clearest to place it at the workflow root (right after the name: and before on:), specifying minimal permissions. A starting point is contents: read, which covers checking out code. If your workflow or job needs additional permissions, you can add them as needed. For this workflow, which just checks out code and runs a Python test file, this minimal set appears sufficient. Add:
permissions:
contents: readright after the name: field and before on:.
| @@ -1,4 +1,6 @@ | ||
| name: Test Parser | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: |
Updated the script to safely parse the testing SDK branch from the PR body, handling case insensitivity and whitespace.
The goal here is to fix the usage of backticks such as in
foo, and contractions that we've been using such aswe'veTESTING_SDK_BRANCH = main
fixes: #118
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.